import axios from "axios"
function getContend(name:string){
    return axios.get(`/src/page/notes/sf/sort/${name}.ts`).then(res => {
        return res.data
        console.log(res.data);
    }).catch(err=>{
        console.log(err);
    })
}

const temp = {
    "sf": [
        {
            "name": "冒泡",
            "id": "popSort"
        },
        {
            "name": "快排",
            "id": "quicklySort"
        },
        {
            "name": "选择排序",
            "id": "selectSort"
        }
    ],
    "others": [
        {
            "name": "动态规划",
            "id": "DC"
        },
        {
            "name": "贪婪算法",
            "id": "DC"
        },
        {
            "name": "迪克斯特拉",
            "id": "DC"
        }
    ]
}

export const result = function(){
    for (const key in temp) {
        temp[key].forEach(async item=>{
            console.log(item);
            item.contend = await getContend(item.id)
        })
     }
     return temp
}
 
